package com.miaoquan.mqportal.feign.hystrix;

import com.miaoquan.mqportal.feign.SearchFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author Fa
 * @date 2020-04-04 23:05
 */
@Component
public class SearchFeignFactory implements FallbackFactory<SearchFeign> {

    private final SearchFeignFallback searchFeignFallback;

    public SearchFeignFactory(SearchFeignFallback searchFeignFallback) {
        this.searchFeignFallback = searchFeignFallback;
    }

    @Override
    public SearchFeign create(Throwable throwable) {
        return searchFeignFallback;
    }

}
